home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Family Forum 261
/
SOMC Family Forum 261.iso
/
WIN32
/
SETUP.RUL
< prev
next >
Wrap
Text File
|
1996-08-07
|
99KB
|
2,811 lines
/*----------------------------------------------------------------------------*\
*
* Installer for : Generic 32-bit installer
*
* Template by : Marty Euerle
* Modified by : Barry Mansur
* Modified on : 02/01/96
* Modified by : Martin Euerle
* on : 7/29/96
*
* NOTES : This is the Generic 16-Bit InstallShield 3 installer script.
* : It does NOT check the operatingsystem.
*
* REVISIONS: 02-16-96 Removed the Product.PF & Personnalize floppy sections.
* Added support for uncompressed files.
* 03-01-96 Added flags for executing QuickTime installer &
* asking a user questions with answers written to text file.
* 07-29-96 Major rewrite, modified the setup.rul file to read all
* neccessary information from the setup.ini file.
*
*
\*----------------------------------------------------------------------------*/
// LAUNCH QUICKTIME INSTALLER
#define LAUNCH_QT 0 // 1 - Launches QuickTime Installer at end of Install
// Do not change the defines listed below
//#define PROGRAM_GROUP_NAME "MECC"
//#define COMPANY_NAME "MECC"
#define BASE_REGISTRYNT "Software\\Microsoft\\Windows NT\\CurrentVersion\\App Paths\\"
#define BASE_REGISTRY95 "Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\"
//#define STR_COMPLETE95 "by selecting the program icon in the Programs menu.\n\n"
//#define STR_COMPLETENT "by selecting the program icon in the program group.\n\n"
declare
#include "sddialog.h"
// Global variables loaded from the setup.ini file.
//PRODUCT NAME & EXECUTABLES
STRING g_strPRODUCT_NAME;
STRING g_strPRODUCT_VERSION;
STRING g_strAPPLICATION_NAME32;
STRING g_strUNINSTALL_KEY; // unique identifier, (name)(media)(version)
//SETUP SCREEN DEFINITION
STRING g_strSETUP_DESCRIPTION; // Displays the Product name + SETUP_DESCRIPTION on the background
NUMBER g_numSETUP_FONT_SIZE; // Define the font size
STRING g_strSETUP_COLOR; // Define the color
//SYSTEM CHECKS
NUMBER g_numREQ_MIN_COLORS; // minimum number of colors for color check
NUMBER g_numREQ_MIN_CPU; // minimum CPU product will run with
// MULTIPLE INSTALL INFO
NUMBER g_numMULTIPLE_INSTALL; // 0 - one install choice, 1 - multiple
NUMBER g_numSIZE_REQ_OPTION_1; // HD Space Required for First or Only Install Option
NUMBER g_numSIZE_REQ_OPTION_2; // HD Space Required for Second Install Option
NUMBER g_numSIZE_REQ_OPTION_3; // HD Space Required for Third Install Option
// MEDIA & FILE TYPES
NUMBER g_numCD_ROM; // 1 - CDROM therefore if Win95, launch Autorun
NUMBER g_numCOPY_UNCOMP; // 1 - Copy Uncompressed Files
NUMBER g_numCOPY_COMP; // 1 - Copy Compressed Files
// APPLICATION PATHS
STRING g_strAPPBASE_PATH_95;
STRING g_strAPPBASE_PATH_NT3x;
STRING g_strAPPBASE_PATH_NT40; // "Program Files\\MECC\\Oregon Trail II\\"
//g_strAPPBASE_PATH_NT3x "MECC\\OTII\\"
// REGISTRY INFO
NUMBER g_numEXTENSION_USED; // 0 - no saved game, 1 - saved game
STRING g_strEXTENSION; // indicates saved game extension Example: afr
//GENERAL PRODUCT DEFINITIONS
STRING g_strPROGRAM_GROUP_NAME; //ex: "MECC"
STRING g_strCOMPANY_NAME; //ex: "MECC"
STRING g_strBASE_REGISTRYNT; //ex: "Software\\Microsoft\\Windows NT\\CurrentVersion\\App Paths\\"
STRING g_strBASE_REGISTRY95; //ex: "Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\"
STRING g_strSTR_COMPLETE95; //ex: "by selecting the program icon in the Programs menu.\n\n"
STRING g_strSTR_COMPLETENT; //ex: "by selecting the program icon in the program group.\n\n"
NUMBER g_numMAX_LINES_INI;
//MESSAGE STRINGS
//SS - SetupScreen
STRING g_strSS_SetTitle;
//CFTL - CompressedFileTransferList
STRING g_strCFTL_SetStatusWindowMsg;
//MIO - Multiple_Installation_Options_
STRING g_strMIO_SetupType;
STRING g_strMIO_SetDialogTitle;
STRING g_strMIO_AskOptionsMessage;
STRING g_strMIO_AskOptionsDescription1;
STRING g_strMIO_AskOptionsDescription2;
STRING g_strMIO_AskOptionsDescription3;
//CR - CheckRequirements
STRING g_strCR_ColorMsg1;
STRING g_strCR_ColorMsg2;
STRING g_strCR_CPUMsg1;
STRING g_strCR_CPUMsg2;
STRING g_strCR_ScreenResolution;
//SI - SystemInfo
STRING g_strSI_Title;
STRING g_strSI_Msg;
STRING g_strSI_System;
STRING g_strSI_CPU;
STRING g_strSI_MEM;
STRING g_strSI_BASEMEM;
STRING g_strSI_EXTENDEDMEM;
STRING g_strSI_VIDEO;
STRING g_strSI_COLORS
STRING g_strSI_Resolution;
STRING g_strSI_Unknown;
STRING g_strSI_Beyond;
STRING g_strSI_VideoDrTypMsg;
STRING g_strSI_VideoTypMsg;
STRING g_strSI_MidiDrTypMsg;
STRING g_strSI_MULTIMEDMSG;
STRING g_strSI_Detected;
STRING g_strSI_NotDetected;
STRING g_strSI_Avi;
STRING g_strSI_QTW;
STRING g_strSI_Wave;
STRING g_strSI_DriveInfo;
STRING g_strSI_CDROM;
STRING g_strSI_DrTypeFixed;
STRING g_strSI_DrTypeRemov;
STRING g_strSI_DrTypeRemote;
STRING g_strSI_FreeSpace;
STRING g_strSI_MB;
// Global variable declarations.
NUMBER nvDiskLocked;
NUMBER OS32_16;
STRING szApplicationName;
STRING svByte;
NUMBER nvByte;
STRING szProductName;
STRING svUserDestDrive; // User chosen installation drive
STRING svGrp, szMsg, szFileSet, szTitle;
STRING szProgram, szTemp, svUninstLogFile, szRegKey;
STRING svMainDirectory[ _MAX_STRING ];
BOOL bSpaceOk, bReshowSetupType;
NUMBER nResult, nType; // nvCONTINUE, nvMyReturn, nStatusId;
// BOOL values for install program file sizes
BOOL bInclude_Copyset1, bInclude_Copyset2, bInclude_Copyset3;
BOOL bTypical, bCompact, bCostum;
BOOL bCustom1, bCustom2, bCustom3;
NUMBER nvStrLen;
STRING svTempStr;
//OS variables
NUMBER nvResult, nvQuitInstaller, nvOS32_16;
STRING svResult;
BOOL bWin3x, bWinNT3x, bWinNT40, bWin95;
STRING APPBASE_PATH;
//File Info variable
STRING szFile, szSourceFile, szTargetFile;
//SystemInfo variables
STRING szInfo, svReturn;
NUMBER nvReturn, nvRETURN;
LIST ListInfo;
//temp values
STRING szSourceDir, szTargetDir;
// variables changed for GetUserInfo
STRING svUserStr1, svUserStr2;
NUMBER nvPersonalize;
// variable for OpenSetupFile()
NUMBER nglobalFileHandle;
STRING svglobalFilePath;
STRING svglobalFileName;
STRING svglobalReturnStr;
STRING svglobalLineStr;
// Function declarations.
// *** EDIT THESE FUNCTIONS FOR EACH NEW INSTALLER ***
prototype WriteTextFile(); // ie. .ini file
prototype MakeIcons();
// *** THESE FUNCTIONS MAY NEED TO BE EDITED ***
prototype CreateRegDBEntries();
prototype CopyFiles();
prototype CompressedFileTransferList();
prototype Single_Installation_Option();
prototype Multiple_Installation_Options();
// These functions need no modifications
prototype CheckSpaceRequirements( number, number, number, string );
prototype DetermineOS();
prototype SetupScreen();
prototype SystemInfo();
prototype CheckRequirements();
prototype InstallReview();
prototype Load_App_Info();
prototype Launch_ThirdPartyInstallers();
prototype Additional_Registry_Info();
prototype Load_Message_Strings();
prototype OpenSetupFile();
prototype CloseSetupFile();
prototype FindLine( string, string, string );
prototype GetNextLine( string, string );
prototype GetCurrentLine( string, string );
STRING svPath; //, svLine1, svLine2;
// ----------------------MAIN PROGRAM---------------------------
program
StartHere:
// ----------------------------------------------------------------
Disable( BACKGROUND );
// Set up the installation screen.
g_numMAX_LINES_INI = 10; // this value will change once the Setup.ini file is loaded.
Load_App_Info();
Load_Message_Strings();
DetermineOS();
SetupScreen();
// Load_Message_Strings();
// Test target system proper configuration.
CheckRequirements();
// Set installation info., which is required for registry entries.
InstallationInfo( g_strCOMPANY_NAME, g_strPRODUCT_NAME, g_strPRODUCT_VERSION, szApplicationName );
// Notify user of rights.
Disable(BACKBUTTON);
if(SdLicense("Software License Agreement", "Know Your Rights (and respect ours, too)",
"Do you accept all the terms of the preceding license agreement? If so, click on the Yes push button. If you select No, Setup will close.",
"license.txt") = YES) then
else
goto quit;
endif;
Enable(BACKBUTTON);
InstallReview();
WelcomeDlg:
// Create a Welcome dialog.
// ----------------------------------------------------------------
Disable( BACKBUTTON );
Welcome( "Welcome", 0 );
Enable( BACKBUTTON );
GetTargetDirectory:
// Ask user for a destination location for the installation.
// ----------------------------------------------------------------
svMainDirectory = TARGETDISK ^ APPBASE_PATH;
szMsg = ""; //Default message displayed
Disable( BACKBUTTON );
AskDestPath( "Choose Destination Location", szMsg, svMainDirectory, 0 );
Enable( BACKBUTTON );
nvStrLen = StrLength(svMainDirectory);
StrSub(svTempStr, svMainDirectory, nvStrLen - 1, 1);
if( StrCompare(svTempStr, "\\") ) then
svMainDirectory = svMainDirectory + "\\";
endif;
//Parse svUserDestDrive;
StrSub(svUserDestDrive, svMainDirectory, 0, 2);
nType = TYPICAL;
DetermineUserSelection:
// ----------------------------------------------------------------
// Determine User Selection & Check Hard Drive Space
// ----------------------------------------------------------------
if(g_numMULTIPLE_INSTALL) then
Multiple_Installation_Options();
if(nvRETURN = 1) then
goto GetTargetDirectory;
elseif(nvRETURN = 2) then
goto DetermineUserSelection;
endif;
else
Single_Installation_Option();
if(bSpaceOk = FALSE) then
goto GetTargetDirectory;
endif;
endif;
FolderSelection:
// ----------------------------------------------------------------
svGrp = g_strPROGRAM_GROUP_NAME;
// Allow user to modify folder name.
if(g_numMULTIPLE_INSTALL) then
if ( SelectFolder( "Folder Selection", svGrp, svGrp ) = BACK ) then
goto DetermineUserSelection;
endif;
else // Single install
if ( SelectFolder( "Folder Selection", svGrp, svGrp ) = BACK ) then
goto GetTargetDirectory;
endif;
endif;
DoFileTransfer:
// ----------------------------------------------------------------
// Prepare InstallSHIELD to record deinstallation information.
if(bWin95 || bWinNT3x) then
DeinstallStart( svMainDirectory, svUninstLogFile, g_strUNINSTALL_KEY, 0 );
RegDBSetItem( REGDB_UNINSTALL_NAME, g_strPRODUCT_NAME );
endif;
// copy compressed program files to user specified location.
if(g_numCOPY_COMP = 1) then
CompressedFileTransferList();
endif;
// copy uncompressed program files to user specified location.
if(g_numCOPY_UNCOMP = 1) then
DetermineOS();
CopyFiles();
endif;
// Set up progress indicator and information gauge.
Enable( STATUSDLG );
// SetRegistryEntries:
// ----------------------------------------------------------------
MakeIcons();
/* ==============Write text file======================================================= */
WriteTextFile();
/* ==============Add any additional registry info====================================== */
Additional_Registry_Info();
SetStatusWindow( 100, "Installation complete." );
// If shared files could not be installed, then users must restart system.
if (BATCH_INSTALL = TRUE) then
szMsg = "Some files could not be installed because they are "+
"currently in use by other programs in the system. "+
"To allow for proper operation of the new program you should restart"+
"your system at this time.";
CommitSharedFiles(0);
RebootDialog( "Restart Windows", szMsg, SYS_BOOTMACHINE );
else
szMsg = "Setup is complete. You may run the installed program ";
if (bWinNT3x) then
szMsg = szMsg + g_strSTR_COMPLETENT;
else
szMsg = szMsg + g_strSTR_COMPLETE95;
endif;
MessageBeep( 0 );
//MessageBox( szMsg, INFORMATION );
endif;
if(bWin95||bWinNT3x) then
CreateRegDBEntries();
//Delay(2);
Disable( FEEDBACK_FULL );
Disable( STATUSDLG );
endif;
/* ==============Launch Third Party Installation Programs=============================== */
Launch_ThirdPartyInstallers();
quit:
// MessageBox( "Installation Complete", INFORMATION );
exit;
// ------------------ END MAIN PROGRAM - Subroutines listed bellow--------
#include "sddialog.rul"
/*---------------------------------------------------------------------------*\
*
* Function: SetupScreen
*
* Purpose: This function will set up the screen look. This includes
* colors, fonts, text to be displayed, etc.
*
*
* Comments:
\*---------------------------------------------------------------------------*/
function SetupScreen()
begin
Enable( INDVFILESTATUS );
if(g_strSETUP_COLOR = "WHITE") then
SetTitle( g_strPRODUCT_NAME + " " + g_strSS_SetTitle, g_numSETUP_FONT_SIZE, WHITE );
elseif(g_strSETUP_COLOR = "YELLOW") then
SetTitle( g_strPRODUCT_NAME +" " + g_strSS_SetTitle, g_numSETUP_FONT_SIZE, YELLOW );
elseif(g_strSETUP_COLOR = "MAGENTA") then
SetTitle( g_strPRODUCT_NAME +" " + g_strSS_SetTitle, g_numSETUP_FONT_SIZE, MAGENTA );
elseif(g_strSETUP_COLOR = "BLUE") then
SetTitle( g_strPRODUCT_NAME +" " + g_strSS_SetTitle, g_numSETUP_FONT_SIZE, BLUE );
elseif(g_strSETUP_COLOR = "GREEN") then
SetTitle( g_strPRODUCT_NAME +" " + g_strSS_SetTitle, g_numSETUP_FONT_SIZE, GREEN );
elseif(g_strSETUP_COLOR = "RED") then
SetTitle( g_strPRODUCT_NAME +" " + g_strSS_SetTitle, g_numSETUP_FONT_SIZE, RED );
endif;
Enable( BACKGROUND );
end;
/*---------------------------------------------------------------------------*\
*
* Function: Load_App_Info
*
* Purpose: This function will load the information placed in the setup.ini file.
*
*
* Comments:
\*---------------------------------------------------------------------------*/
function Load_App_Info()
begin
OpenSetupFile();
// *************************** [SETUP.INI INFO] ****************************************
FindLine("[", "]", "SETUP.INI INFO");
GetNextLine( "<", ">" );
StrToNum(g_numMAX_LINES_INI, svglobalReturnStr);
//MessageBox("load ini g_numMAX_LINES_INI: " + svglobalReturnStr, INFORMATION);
// *************************** [PRODUCT NAME & EXECUTABLES] ****************************
FindLine("[", "]", "PRODUCT NAME & EXECUTABLES");
GetNextLine( "<", ">" );
g_strPRODUCT_NAME = svglobalReturnStr;
//MessageBox("load ini g_strPRODUCT_NAME: " + g_strPRODUCT_NAME, INFORMATION);
GetNextLine( "<", ">" );
g_strPRODUCT_VERSION = svglobalReturnStr;
//MessageBox("load ini g_strPRODUCT_VERSION: " + g_strPRODUCT_VERSION, INFORMATION);
GetNextLine( "<", ">" );
g_strAPPLICATION_NAME32 = svglobalReturnStr;
//MessageBox("load ini g_strAPPLICATION_NAME32: " + g_strAPPLICATION_NAME32, INFORMATION);
GetNextLine( "<", ">" );
g_strUNINSTALL_KEY = svglobalReturnStr;
//MessageBox("load ini g_strUNINSTALL_KEY: " + g_strUNINSTALL_KEY, INFORMATION);
// *************************** [SETUP SCREEN DEFINITION] *******************************
FindLine("[", "]", "SETUP SCREEN DEFINITION");
GetNextLine( "<", ">" );
g_strSETUP_DESCRIPTION = svglobalReturnStr;
//MessageBox("load ini g_strSETUP_DESCRIPTION: " + g_strSETUP_DESCRIPTION, INFORMATION);
GetNextLine( "<", ">" );
StrToNum(g_numSETUP_FONT_SIZE, svglobalReturnStr);
//MessageBox("load ini g_numSETUP_FONT_SIZE: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
g_strSETUP_COLOR = svglobalReturnStr;
//MessageBox("load ini g_strSETUP_COLOR: " + g_strSETUP_COLOR, INFORMATION);
// *************************** [SYSTEM CHECKS] *****************************************
FindLine("[", "]", "SYSTEM CHECKS");
GetNextLine( "<", ">" );
StrToNum(g_numREQ_MIN_COLORS, svglobalReturnStr);
//MessageBox("load ini g_numREQ_MIN_COLORS: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
StrToNum(g_numREQ_MIN_CPU, svglobalReturnStr);
//MessageBox("load ini g_numREQ_MIN_CPU: " + svglobalReturnStr, INFORMATION);
// *************************** [MULTIPLE INSTALL INFO] *********************************
FindLine("[", "]", "MULTIPLE INSTALL INFO");
GetNextLine( "<", ">" );
StrToNum(g_numMULTIPLE_INSTALL, svglobalReturnStr);
//MessageBox("load ini g_numMULTIPLE_INSTALL: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
StrToNum(g_numSIZE_REQ_OPTION_1, svglobalReturnStr);
//MessageBox("load ini g_numSIZE_REQ_OPTION_1: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
StrToNum(g_numSIZE_REQ_OPTION_2, svglobalReturnStr);
//MessageBox("load ini g_numSIZE_REQ_OPTION_2: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
StrToNum(g_numSIZE_REQ_OPTION_3, svglobalReturnStr);
//MessageBox("load ini g_numSIZE_REQ_OPTION_3: " + svglobalReturnStr, INFORMATION);
// *************************** [MEDIA & FILE TYPES] ************************************
FindLine("[", "]", "MEDIA & FILE TYPES");
GetNextLine( "<", ">" );
StrToNum(g_numCD_ROM, svglobalReturnStr);
//MessageBox("load ini g_numCD_ROM: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
StrToNum(g_numCOPY_UNCOMP, svglobalReturnStr);
//MessageBox("load ini g_numCOPY_UNCOMP: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
StrToNum(g_numCOPY_COMP, svglobalReturnStr);
//MessageBox("load ini g_numCOPY_COMP: " + svglobalReturnStr, INFORMATION);
// *************************** [APPLICATION PATHS] *************************************
FindLine("[", "]", "APPLICATION PATHS");
GetNextLine( "<", ">" );
g_strAPPBASE_PATH_95 = svglobalReturnStr;
//MessageBox("load ini g_strAPPBASE_PATH_95: " + g_strAPPBASE_PATH_95, INFORMATION);
GetNextLine( "<", ">" );
g_strAPPBASE_PATH_NT3x = svglobalReturnStr;
//MessageBox("load ini g_strAPPBASE_PATH_NT3x: " + g_strAPPBASE_PATH_NT3x, INFORMATION);
GetNextLine( "<", ">" );
g_strAPPBASE_PATH_NT40 = svglobalReturnStr;
//MessageBox("load ini g_strAPPBASE_PATH_NT40: " + g_strAPPLICATION_NAME32, INFORMATION);
// *************************** [REGISTRY INFO] *****************************************
FindLine("[", "]", "REGISTRY INFO");
GetNextLine( "<", ">" );
StrToNum(g_numEXTENSION_USED, svglobalReturnStr);
//MessageBox("load ini g_numEXTENSION_USED: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
g_strEXTENSION = svglobalReturnStr;
//MessageBox("load ini g_strEXTENSION: " + g_strEXTENSION, INFORMATION);
// *************************** [GENERAL PRODUCT DEFINITIONS] ***************************
FindLine("[", "]", "GENERAL PRODUCT DEFINITIONS");
GetNextLine( "<", ">" );
g_strPROGRAM_GROUP_NAME = svglobalReturnStr;
//MessageBox("load ini g_strPROGRAM_GROUP_NAME: " + g_strPROGRAM_GROUP_NAME, INFORMATION);
GetNextLine( "<", ">" );
g_strCOMPANY_NAME = svglobalReturnStr;
//MessageBox("load ini g_strCOMPANY_NAME: " + g_strCOMPANY_NAME, INFORMATION);
GetNextLine( "<", ">" );
g_strBASE_REGISTRYNT = svglobalReturnStr;
//MessageBox("load ini g_strBASE_REGISTRYNT: " + g_strBASE_REGISTRYNT, INFORMATION);
GetNextLine( "<", ">" );
g_strBASE_REGISTRY95 = svglobalReturnStr;
//MessageBox("load ini g_strBASE_REGISTRY95: " + g_strBASE_REGISTRY95, INFORMATION);
GetNextLine( "<", ">" );
g_strSTR_COMPLETE95 = svglobalReturnStr;
//MessageBox("load ini g_strSTR_COMPLETE95: " + g_strAPPLICATION_NAME32, INFORMATION);
GetNextLine( "<", ">" );
g_strSTR_COMPLETENT = svglobalReturnStr;
//MessageBox("load ini g_strUNINSTALL_KEY: " + g_strUNINSTALL_KEY, INFORMATION);
CloseSetupFile();
end;
/*---------------------------------------------------------------------------*\
*
* Function: Launch_ThirdPartyInstallers()
*
* Purpose: To launch addition third party installation programs.
*
* Input:
*
* Returns:
*
* Comments:
\*---------------------------------------------------------------------------*/
function Launch_ThirdPartyInstallers()
BOOL blocalWhileDone;
BOOL blocalDo3x;
BOOL blocalDo95;
BOOL blocalDoNT;
BOOL blocalDoInstall;
BOOL blocalDoPlateformInstall;
BOOL blocalWait;
STRING svTemp;
STRING svPlateform;
STRING svDialogTitle;
STRING svDialogMessage;
STRING svInstallPath;
STRING svlocalRootKey;
STRING svlocalKey;
STRING svlocalKeyName;
begin
OpenSetupFile();
// *************************** [THIRD PARTY INSTALLATION PROGRAM] 0 - no, 1 - yes ******
FindLine("[", "]", "THIRD PARTY INSTALLATION PROGRAM");
GetNextLine( "<", ">" );
svTemp = svglobalReturnStr;
blocalDoInstall = FALSE;
if(svTemp = "1") then
blocalDoInstall = TRUE;
endif;
while(blocalDoInstall)
//if(blocalDoInstall) then
GetNextLine( "<", ">" );
svPlateform = svglobalReturnStr;
//MessageBox("load ini svPlateform: " + svglobalReturnStr, INFORMATION);
StrSub(svTemp, svPlateform, 0, 1); // Get 3x
//MessageBox("blocalDo3x: " + svTemp, INFORMATION);
if(svTemp = "1") then
blocalDo3x = TRUE;
else
blocalDo3x = FALSE;
endif;
StrSub(svTemp, svPlateform, 1, 1); // Get 95
//MessageBox("blocalDo95: " + svTemp, INFORMATION);
if(svTemp = "1") then
blocalDo95 = TRUE;
else
blocalDo95 = FALSE;
endif;
StrSub(svTemp, svPlateform, 2, 1); // Get NT
//MessageBox("blocalDoNT: " + svTemp, INFORMATION);
if(svTemp = "1") then
blocalDoNT = TRUE;
else
blocalDoNT = FALSE;
endif;
// This is a goofy way to do it but it seems to be the only
// way to make sure I don't do an unintensional installation.
if(bWin3x) then
if(bWin3x = blocalDo3x) then
blocalDoPlateformInstall = TRUE;
endif;
endif;
if(bWin95) then
if(bWin95 = blocalDo95) then
blocalDoPlateformInstall = TRUE;
endif;
endif;
if(bWinNT3x) then
if(bWinNT3x = blocalDoNT) then
blocalDoPlateformInstall = TRUE;
endif;
endif;
if(blocalDoPlateformInstall) then
GetNextLine( "<", ">" );
svTemp = svglobalReturnStr;
//MessageBox("load ini blocalFindKey: " + svglobalReturnStr, INFORMATION);
if(svTemp = "1") then // we wait until we find the key in the registry
GetNextLine( "<", ">" );
svlocalRootKey = svglobalReturnStr;
//MessageBox("load ini svlocalRootKey: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
svlocalKey = svglobalReturnStr;
//MessageBox("load ini svlocalKey: " + svglobalReturnStr, INFORMATION);
if(svlocalKey = "HKEY_CLASSES_ROOT") then
RegDBSetDefaultRoot(HKEY_CLASSES_ROOT);
elseif(svlocalKey = "HKEY_CURRENT_USER") then
RegDBSetDefaultRoot(HKEY_CURRENT_USER);
elseif(svlocalKey = "HKEY_LOCAL_MACHINE") then
RegDBSetDefaultRoot(HKEY_CLASSES_ROOT);
elseif(svlocalKey = "HKEY_USERS") then
RegDBSetDefaultRoot(HKEY_CLASSES_ROOT);
elseif(svlocalKey = "HKEY_CURRENT_CONFIG") then
RegDBSetDefaultRoot(HKEY_CLASSES_ROOT);
elseif(svlocalKey = "HKEY_DYN_DATA") then
RegDBSetDefaultRoot(HKEY_CLASSES_ROOT);
endif;
blocalWhileDone = FALSE;
while(!blocalWhileDone)
if(RegDBKeyExist(svlocalKey) < 0 ) then
//MessageBox("Failed to find the key", INFORMATION);
else
//MessageBox("found the key", INFORMATION);
blocalWhileDone = TRUE;
endif;
Delay(1);
endwhile;
else
// this gets us past the KEY stuff in the Setup.ini file
GetNextLine( "<", ">" );
GetNextLine( "<", ">" );
endif;
GetNextLine( "<", ">" );
svTemp = svglobalReturnStr;
//MessageBox("load ini blocalWait: " + svglobalReturnStr, INFORMATION);
blocalWait = FALSE;
if(svTemp = "1") then
blocalWait = TRUE;
endif;
GetNextLine( "<", ">" );
svDialogTitle = svglobalReturnStr;
//MessageBox("load ini svDialogTitle: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
svDialogMessage = svglobalReturnStr;
//MessageBox("load ini svDialogMessage: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
svInstallPath = svglobalReturnStr;
//MessageBox("load ini svInstallPath: " + svglobalReturnStr, INFORMATION);
SetDialogTitle(DLG_ASK_YESNO, svDialogTitle);
if( AskYesNo(svDialogMessage, YES) = YES) then
svPath = SRCDISK + svInstallPath;
//MessageBox("end launch: " + svPath, INFORMATION);
Disable(BACKGROUND);
Delay( 1 );
if(blocalWait) then
//MessageBox("WAIT", INFORMATION);
if(LaunchAppAndWait(svPath, "", WAIT) = 0) then
//MessageBox("app successfully launched", INFORMATION);
else
//MessageBox("app not successfully launched", INFORMATION);
endif;
else
//MessageBox("NOWAIT", INFORMATION);
if(LaunchAppAndWait(svPath, "", NOWAIT) = 0) then
//MessageBox("app successfully launched", INFORMATION);
else
//MessageBox("app not successfully launched", INFORMATION);
endif;
endif;
endif;
endif; //if(blocalDoPlateformInstall) then
//endif; //if(blocalDoInstall) then
GetNextLine( "<", ">" );
svTemp = svglobalReturnStr;
blocalDoInstall = FALSE;
if(svTemp = "1") then
blocalDoInstall = TRUE;
endif;
endwhile;
OpenSetupFile();
end;
/*---------------------------------------------------------------------------*\
*
* Function: SystemInfo()
*
* Purpose: To display useful system information.
*
* Input:
*
* Returns:
*
* Comments:
\*---------------------------------------------------------------------------*/
function SystemInfo()
STRING svFilePath, svFileName, svVideoStr, svMidiStr, svDrive;
STRING svAVI, svQTW, svWave, svMCI, svDrivers;
NUMBER nvAVIFound, nvQTWFound, nvWaveFound, nvBootDesFound, nvMCIFound, nvDriversFound;
NUMBER nvFileHandle, nvCount, nvStrPos, nvContinue, nvVideoFound, nvMidiFound;
NUMBER nvDriveCount;
begin
szTitle = g_strSI_Title; //"System Information";
szMsg = g_strSI_Msg; //"The following is information about your system:";
ListInfo = ListCreate(STRINGLIST);
szInfo = g_strSI_System; //"System: ";
if(bWin3x) then
szInfo = szInfo + "Win3.x";
elseif(bWinNT3x) then
szInfo = szInfo + "WinNT";
else
szInfo = szInfo + "Win95";
endif;
ListAddString(ListInfo, szInfo, AFTER);
//CPU check -------------
GetSystemInfo( CPU, nvReturn, svReturn );
NumToStr(svReturn, nvReturn);
// szInfo = "CPU: " + svReturn;
szInfo = g_strSI_CPU + " " + svReturn;
ListAddString(ListInfo, szInfo, AFTER);
szInfo = "";
ListAddString(ListInfo, szInfo, AFTER);
szInfo = g_strSI_MEM; //"MEMORY:";
ListAddString(ListInfo, szInfo, AFTER);
//BASEMEMORY check -------------
GetSystemInfo( BASEMEMORY, nvReturn, svReturn );
NumToStr(svReturn, nvReturn);
szInfo = " ";
// szInfo = szInfo + "Base Memory: " + svReturn;
szInfo = szInfo + g_strSI_BASEMEM + " " + svReturn;
ListAddString(ListInfo, szInfo, AFTER);
//EXTENDEDMEMORY check -------------
GetSystemInfo( EXTENDEDMEMORY, nvReturn, svReturn );
NumToStr(svReturn, nvReturn);
szInfo = " ";
// szInfo = szInfo + "Extended Memory: " + svReturn;
szInfo = szInfo + g_strSI_EXTENDEDMEM + " " + svReturn;
ListAddString(ListInfo, szInfo, AFTER);
// VIDEO VIDEO VIDEO VIDEO VIDEO VIDEO VIDEO VIDEO VIDEO VIDEO VIDEO VIDEO
// VIDEO VIDEO VIDEO VIDEO VIDEO VIDEO VIDEO VIDEO VIDEO VIDEO VIDEO VIDEO
szInfo = "";
ListAddString(ListInfo, szInfo, AFTER);
szInfo = g_strSI_VIDEO; //"VIDEO:";
ListAddString(ListInfo, szInfo, AFTER);
//# COLORS check -------------
GetSystemInfo( COLORS, nvReturn, svReturn );
NumToStr(svReturn, nvReturn);
szInfo = " ";
// szInfo = szInfo + "Colors: " + svReturn;
szInfo = szInfo + g_strSI_COLORS + " " + svReturn;
ListAddString(ListInfo, szInfo, AFTER);
// resolution check -------------------------------------
szInfo = " ";
if( GetSystemInfo( VIDEO, nvReturn, svReturn ) < 0 ) then
// szInfo = szInfo + "Resolution: Unknown";
szInfo = szInfo + g_strSI_Resolution + " " + g_strSI_Unknown;
else
switch( nvReturn )
case IS_EGA: szInfo = szInfo + g_strSI_Resolution + " EGA";
case IS_VGA: szInfo = szInfo + g_strSI_Resolution + " 640 X 480";
case IS_SVGA: szInfo = szInfo + g_strSI_Resolution + " 800 x 600";
case IS_XVGA: szInfo = szInfo + g_strSI_Resolution + " 1024 x 768";
case IS_UVGA: szInfo = szInfo + g_strSI_Resolution + " " + g_strSI_Beyond + " 1024 x 768";
case IS_UNKNOWN: szInfo = szInfo + g_strSI_Resolution + " " + g_strSI_Unknown;
endswitch;
endif;
ListAddString(ListInfo, szInfo, AFTER);
// Determine video driver type
// ---------------------------------------------------------------
nvReturn = FindFile(WINDIR, "system.ini", svFileName);
NumToStr(svReturn, nvReturn);
//szInfo = "Video Driver Type:";
if(nvReturn = 0 ) then
nvContinue = 1;
else
nvContinue = 0;
endif;
if(nvContinue = 1) then
if (OpenFileMode(FILE_MODE_NORMAL) < 0 ) then
nvContinue = 0;
else
nvContinue = 1;
endif;
endif;
svFilePath = WINDIR;
svFileName = "system.ini";
if(nvContinue = 1) then
if( OpenFile(nvFileHandle, svFilePath, svFileName) < 0 ) then
nvContinue = 0;
else
nvContinue = 1;
endif;
endif;
if(nvContinue = 1) then
nvVideoFound = 0;
nvMidiFound = 0;
nvAVIFound = 0;
nvQTWFound = 0;
nvWaveFound = 0;
nvBootDesFound = 0;
nvMCIFound = 0;
nvDriversFound = 0;
while( nvCount < 150 )
nvReturn = GetLine(nvFileHandle, svReturn);
// [MCI] ***
nvStrPos = StrFind(svReturn, "[mci]");
if(nvStrPos = 0) then
nvMCIFound = 1;
endif;
if(nvMCIFound = 1) then
if (nvStrPos = StrFind(svReturn, "avivideo") = 0) then
//NumToStr(szFile, nvCount);
//MessageBox("avi found line: " + szFile + " " + svReturn, INFORMATION);
svAVI = svReturn;
endif;
if(nvStrPos = 0) then
//if(nvAVIFound = 0) then
svAVI = svReturn;
// MessageBox("avi: " + svAVI, INFORMATION);
NumToStr(szFile, nvMCIFound);
NumToStr(svReturn, nvAVIFound);
// MessageBox("nvMCIFound= " + szFile + ", nvAVIFound= " + svReturn, INFORMATION);
nvAVIFound = 1;
//endif;
nvAVIFound = 1;
endif;
endif;
nvStrPos = StrFind(svReturn, "QTWVideo=");
if(nvMCIFound = 1) then
if(nvStrPos = 0) then
svQTW = svReturn;
nvQTWFound = 1;
endif;
endif;
// [drivers] ***
nvStrPos = StrFind(svReturn, "[drivers]");
if(nvStrPos = 0) then
nvDriversFound = 1;
endif;
nvStrPos = StrFind(svReturn, "wave=");
if(nvDriversFound = 1) then
if(nvStrPos = 0) then
svWave = svReturn;
nvWaveFound = 1;
endif;
endif;
nvStrPos = StrFind(svReturn, "[boot.description]");
if(nvStrPos = 0) then
nvBootDesFound = 1;
endif;
if(nvVideoFound = 0) then
nvStrPos = StrFind(svReturn, "display.drv=");
if(nvStrPos = 0) then
if(bWin95) then
if(nvBootDesFound = 1) then
svVideoStr = svReturn;
nvVideoFound = 1;
endif;
else
svVideoStr = svReturn;
nvVideoFound = 1;
endif;
endif;
endif;
if(nvMidiFound = 0) then
nvStrPos = StrFind(svReturn, "MIDI=");
if(nvStrPos = 0) then
svMidiStr = svReturn;
nvMidiFound = 1;
endif;
endif;
nvCount = nvCount + 1;
endwhile;
endif;
if(nvVideoFound = 0) then
svVideoStr = g_strSI_VideoTypMsg + " " + g_strSI_Unknown; //"Video type: Unknown";
endif;
if(nvMidiFound = 0) then
svMidiStr = g_strSI_MidiDrTypMsg + " " + g_strSI_Unknown; //"Midi driver: Unknown";
endif;
//if(nvMCIFound
szInfo = " ";
szInfo = szInfo + svVideoStr;
ListAddString(ListInfo, szInfo, AFTER);
// MULTIMEDIA MULTIMEDIA MULTIMEDIA MULTIMEDIA MULTIMEDIA MULTIMEDIA
// MULTIMEDIA MULTIMEDIA MULTIMEDIA MULTIMEDIA MULTIMEDIA MULTIMEDIA
szInfo = "";
ListAddString(ListInfo, szInfo, AFTER);
szInfo = g_strSI_MULTIMEDMSG; //"MULTIMEDIA:";
ListAddString(ListInfo, szInfo, AFTER);
szInfo = " ";
if(nvAVIFound = 1) then
szInfo = szInfo + svAVI;
ListAddString(ListInfo, szInfo, AFTER);
else
// szInfo = szInfo + "avivideo=Not detected";
szInfo = szInfo + g_strSI_Avi + g_strSI_NotDetected;
ListAddString(ListInfo, szInfo, AFTER);
endif;
szInfo = " ";
if(nvQTWFound = 1) then
// szInfo = szInfo + "QTWVideo=Detected";
szInfo = szInfo + g_strSI_QTW + g_strSI_Detected;
ListAddString(ListInfo, szInfo, AFTER);
else
// szInfo = szInfo + "QTWVideo=Not detected";
szInfo = szInfo + g_strSI_QTW + g_strSI_NotDetected;
ListAddString(ListInfo, szInfo, AFTER);
endif;
szInfo = " ";
if(nvWaveFound = 1) then
szInfo = szInfo + svWave;
ListAddString(ListInfo, szInfo, AFTER);
else
// szInfo = szInfo + "wave=Not detected";
szInfo = szInfo + g_strSI_Wave + g_strSI_NotDetected;
ListAddString(ListInfo, szInfo, AFTER);
endif;
szInfo = " ";
szInfo = szInfo + svMidiStr;
ListAddString(ListInfo, szInfo, AFTER);
// DRIVE INFO DRIVE INFO DRIVE INFO DRIVE INFO DRIVE INFO DRIVE INFO
// DRIVE INFO DRIVE INFO DRIVE INFO DRIVE INFO DRIVE INFO DRIVE INFO
szInfo = "";
ListAddString(ListInfo, szInfo, AFTER);
szInfo = g_strSI_DriveInfo; //"DRIVE INFO:";
ListAddString(ListInfo, szInfo, AFTER);
//CDROM check ----------------
GetSystemInfo( CDROM, nvReturn, svReturn );
szInfo = " ";
if( nvReturn = TRUE ) then
// szInfo = szInfo + "CD-ROM detected: yes";
szInfo = szInfo + g_strSI_CDROM + " " + g_strSI_Detected;
else
// szInfo = szInfo + "CD-ROM detected: no";
szInfo = szInfo + g_strSI_CDROM + " " + g_strSI_NotDetected;
endif;
ListAddString(ListInfo, szInfo, AFTER);
// determine drive type and space available
for nvDriveCount = 1 to 5
if(nvDriveCount = 1) then
svDrive = "C:";
elseif(nvDriveCount = 2) then
svDrive = "D:";
elseif(nvDriveCount = 3) then
svDrive = "E:";
elseif(nvDriveCount = 4) then
svDrive = "F:";
elseif(nvDriveCount = 5) then
svDrive = "G:";
endif;
if( GetSystemInfo( DRIVE, nvReturn, svDrive ) < 0 ) then
szInfo = " ";
szInfo = szInfo + svDrive + " " + g_strSI_Unknown; //" undetermined,";
else
szInfo = " ";
szInfo = szInfo + svDrive;
switch( nvReturn )
case IS_FIXED: szInfo = szInfo + " " + g_strSI_DrTypeFixed; //" fixed,";
case IS_REMOVABLE: szInfo = szInfo + " " + g_strSI_DrTypeRemov; //" removable,";
case IS_REMOTE: szInfo = szInfo + " " + g_strSI_DrTypeRemote; //" network,";
case IS_UNKNOWN: szInfo = szInfo + " " + g_strSI_Unknown; //" unknown,";
default: szInfo = szInfo + " " + g_strSI_Unknown; //" unknown,";
endswitch;
endif;
nvReturn = GetDiskSpace(svDrive);
nvReturn = nvReturn / 1048576; // divide by 1 mbyte
NumToStr( svReturn, nvReturn );
// szInfo = szInfo + " Free Space: " + svReturn + " MB";
szInfo = szInfo + " " + g_strSI_FreeSpace + " " + svReturn + g_strSI_MB;
ListAddString(ListInfo, szInfo, AFTER);
// ***
endfor;
Disable( BACKBUTTON );
SdShowInfoList( szTitle, szMsg, ListInfo );
Enable( BACKBUTTON );
end;
/* -------------------------------------------------------------------------
* Function: CompressedFileTransferList()
* Purpose:
*
* -------------------------------------------------------------------------*/
function CompressedFileTransferList()
begin
TARGETDIR = svMainDirectory;
Enable(STATUS);
// SetStatusWindow(0, "Copying and Decompressing Files...");
SetStatusWindow(0, g_strCFTL_SetStatusWindowMsg);
TARGETDIR = svMainDirectory;
//szFileSet = "General";
szFileSet = "copyfile";
if(bTypical) then
//Include the TYPICAL file set
FileSetBeginDefine("copyfile");
szTargetDir = TARGETDIR;
if( bWinNT3x ) then
TARGETDIR = WINDIR + "system32";
CompressGet( "data.z", "file1\\*.*", SHAREDFILE|COMP_UPDATE_DATE );
endif;
if( bWin95 ) then
TARGETDIR = WINDIR + "system";
CompressGet( "data.z", "file1\\*.*", SHAREDFILE|COMP_UPDATE_DATE );
endif;
TARGETDIR = szTargetDir;
FileSetEndDefine("copyfile");
endif;
/*
if(bCompact) then
//Include the COMPACT file set
FileSetBeginDefine(szFileSet);
//StatusUpdate(ON, 40);
CompressGet( "data.z", "program\\*.*", COMP_NORMAL );
//StatusUpdate(OFF, 0);
//StatusUpdate(ON, 60);
CompressGet( "data.z", "File1\\*.*", COMP_NORMAL );
FileSetEndDefine(szFileSet);
endif;
if(bCostum) then
if(bCustom1) then
//Include the CUSTOM file set 1
FileSetBeginDefine(szFileSet);
//StatusUpdate(ON, 40);
CompressGet( "data.z", "program\\*.*", COMP_NORMAL );
//StatusUpdate(OFF, 0);
//StatusUpdate(ON, 60);
CompressGet( "data.z", "File1\\*.*", COMP_NORMAL );
FileSetEndDefine(szFileSet);
endif;
if(bCustom2) then
//Include the CUSTOM file set 2
FileSetBeginDefine(szFileSet);
//StatusUpdate(ON, 40);
CompressGet( "data.z", "program\\*.*", COMP_NORMAL );
//StatusUpdate(OFF, 0);
//StatusUpdate(ON, 60);
CompressGet( "data.z", "File1\\*.*", COMP_NORMAL );
FileSetEndDefine(szFileSet);
endif;
if(bCustom3) then
//Include the CUSTOM file set 3
FileSetBeginDefine(szFileSet);
//StatusUpdate(ON, 40);
CompressGet( "data.z", "program\\*.*", COMP_NORMAL );
//StatusUpdate(OFF, 0);
//StatusUpdate(ON, 60);
CompressGet( "data.z", "File1\\*.*", COMP_NORMAL );
FileSetEndDefine(szFileSet);
endif;
endif; // CUSTOM
*/
StatusUpdate(ON, 100);
// MessageBox("SUPPORTDIR: " + SUPPORTDIR, INFORMATION);
// MessageBox("Files copied to: " + TARGETDIR, INFORMATION);
FileSetPerformEz("copyfile", 0);
end;
/* -------------------------------------------------------------------------
* Function: Multiple_Installation_Options()
* Purpose:
*
* -------------------------------------------------------------------------*/
// STRING g_strMIO_SetupType;
// STRING g_strMIO_SetDialogTitle;
// STRING g_strMIO_AskOptionsMessage;
// STRING g_strMIO_AskOptionsDescription1;
// STRING g_strMIO_AskOptionsDescription2;
// STRING g_strMIO_AskOptionsDescription3;
function Multiple_Installation_Options()
NUMBER nvLocalResult;
begin
nvRETURN = 0;
nvLocalResult = 0;
nType = 301;
nType = SetupType( g_strMIO_SetupType, "", svMainDirectory, nType, 0 );
if ( nType = BACK ) then
//MessageBox("in: Multiple_Installation_Options. nvReturn = 1", INFORMATION);
nvRETURN = 1; // set for: goto GetTargetDirectory
endif;
if(nvRETURN = 0) then
bReshowSetupType = FALSE;
bTypical = FALSE;
bCompact = FALSE;
bCostum = FALSE;
bCustom1 = FALSE;
bCustom2 = FALSE;
bCustom3 = FALSE;
// ***** DETERMINES THE 3 OPTIONS THE USER CAN SELECT - CHANGE THESE AS APPROPRIATE *****
switch (nType)
case TYPICAL:
bInclude_Copyset1 = TRUE;
case COMPACT:
bInclude_Copyset3 = TRUE;
case CUSTOM:
SetDialogTitle( DLG_ASK_OPTIONS, g_strMIO_SetDialogTitle );
szMsg = g_strMIO_AskOptionsMessage;
nvLocalResult = AskOptions( EXCLUSIVE, szMsg,
g_strMIO_AskOptionsDescription1, bInclude_Copyset1,
g_strMIO_AskOptionsDescription2, bInclude_Copyset2,
g_strMIO_AskOptionsDescription3, bInclude_Copyset3);
endswitch;
endif;
if ( nvLocalResult = BACK ) then
nvRETURN = 2; // set for: goto DetermineUserSelection
endif;
// Handle user clicking Cancel button.
/*
if(nvRETURN = 0) then
if (nvLocalResult = CANCEL) then
if (AskYesNo( "Are you sure you would like to exit setup?", NO ) = YES) then
abort;
else
bReshowSetupType = TRUE;
endif;
endif;
endif;
*/
if (bReshowSetupType = TRUE) then
nvRETURN = 2; // set for: goto DetermineUserSelection
endif;
// Check to see if target system meets space requirements.
if( nvRETURN = 0 ) then
bSpaceOk = CheckSpaceRequirements( bInclude_Copyset1,
bInclude_Copyset2,
bInclude_Copyset3,
svUserDestDrive );
// Ask user to try again if not enough space available.
if (bSpaceOk = FALSE) then
nvRETURN = 1; // set for: goto GetTargetDirectory;
endif;
endif;
end;
/* -------------------------------------------------------------------------*\
* Function: Single_Installation_Option()
*
* Purpose: This section used if only one set of files to install.
* This sets up the sections of files & compressed files to copy
* Also checks the total space required.
*
* Input:
*
* Returns:
*
* Comments: Edit these section if needed.
*
\*-------------------------------------------------------------------------*/
function Single_Installation_Option()
begin
// **********************************
// CHANGE THESE AS APPROPRIATE
bTypical = TRUE;
bCompact = FALSE;
bCostum = FALSE;
bCustom1 = FALSE;
bCustom2 = FALSE;
bCustom3 = FALSE;
bInclude_Copyset1 = TRUE;
bInclude_Copyset2 = FALSE;
bInclude_Copyset3 = FALSE;
bSpaceOk = CheckSpaceRequirements( bInclude_Copyset1,
bInclude_Copyset2,
bInclude_Copyset3,
svUserDestDrive );
end;
/* -------------------------------------------------------------------------*\
* Function: DetermineOS()
*
* Purpose: To determine the current operating system.
* Set the appropriate path and product name.
*
* Input: GetSystemInfo,
*
* Returns: szApplicationName,APPBASE_PATH,nvOS32_16
*
* Comments:
*
\*-------------------------------------------------------------------------*/
function DetermineOS()
NUMBER nvLocalValue;
STRING svLocalResult;
begin
GetSystemInfo(OS, nvResult, svResult);
bWinNT3x = FALSE;
bWinNT40 = FALSE;
bWin3x = FALSE;
bWin95 = FALSE;
if(nvResult = IS_WINDOWS) then
bWin3x = TRUE; //Program should exit 32-bit installer
szApplicationName = g_strAPPLICATION_NAME32; // if running under Win 3.x
APPBASE_PATH = g_strAPPBASE_PATH_95;
nvOS32_16 = 0;
elseif(nvResult = IS_WINDOWSNT) then
GetSystemInfo (OSMAJOR, nvResult, svResult);
if(nvResult < 4) then
bWinNT3x = TRUE;
szApplicationName = g_strAPPLICATION_NAME32;
APPBASE_PATH = g_strAPPBASE_PATH_NT3x;
nvOS32_16 = 1;
else
bWinNT40 = TRUE;
szApplicationName = g_strAPPLICATION_NAME32;
APPBASE_PATH = g_strAPPBASE_PATH_NT40;
nvOS32_16 = 1;
endif;
elseif(nvResult = IS_WINDOWS95) then
bWin95 = TRUE;
szApplicationName = g_strAPPLICATION_NAME32;
APPBASE_PATH = g_strAPPBASE_PATH_95;
nvOS32_16 = 1;
endif;
nvQuitInstaller = 0;
if(nvOS32_16 = 1) then
nvQuitInstaller = 1;
endif;
end;
/* -------------------------------------------------------------------------*\
* Function: CopyFiles()
*
* Purpose: To copy files from the source directory to the destination
* directory.
*
* Input: g_numCOPY_UNCOMP, SCRDIR, TARGETDIR, CD_ROM
*
* Returns:
*
* Comments: Edit this function as required.
* Performs file copies of UNCOMPRESSED files.
* Copies files for multiple install options if required.
\* -------------------------------------------------------------------------*/
function CopyFiles()
STRING svlocalSOURC_LOCATION;
STRING svlocalTARGET_LOCATION;
STRING svlocalSaveSourceDir;
STRING svlocalSaveTargetDir;
BOOL blocalDo3x;
BOOL blocalDo95;
BOOL blocalDoNT;
BOOL blocalDoCopySet1;
BOOL blocalDoCopySet2;
BOOL blocalDoCopySet3;
BOOL blocalDone;
BOOL blocalDoPlateformCopy;
BOOL blocalDoCopySet;
NUMBER nvlocalFileSetSize;
NUMBER nvlocalFileSize;
NUMBER nvlocalTotalFileSize;
NUMBER nvlocalUpdateNum;
NUMBER nvlocalInitialStatus;
NUMBER nvlocalResult, nvlocalFileHandle;
NUMBER nvlocalFirstPos, nvlocalLastPos;
NUMBER nvStrLength;
STRING svlocalFilePath, svlocalFileName;
STRING svlocalLine, svlocalFirstChar;
STRING svTemp;
STRING svlocalStr;
STRING svlocalEatStr;
STRING svlocalStoreStr;
STRING svlocalGROUP_NAME;
STRING svlocalITEM_NAME;
STRING svlocalAPP_PATH;
STRING svlocalAPP_DIR;
STRING svlocalICON_PATH;
begin
Enable(STATUS);
nvlocalTotalFileSize = 0;
svlocalSaveSourceDir = SRCDIR;
svlocalSaveTargetDir = svMainDirectory;
blocalDone = FALSE;
svlocalFilePath = svlocalSaveSourceDir;
svlocalFileName = "Setup.ini";
OpenFileMode(FILE_MODE_NORMAL);
OpenFile(nvlocalFileHandle, svlocalFilePath, svlocalFileName);
nvlocalResult = 0;
while(!blocalDone)
nvlocalResult = nvlocalResult + 1;
if(nvlocalResult > g_numMAX_LINES_INI) then
blocalDone = TRUE;
MessageBox("Setup.ini Error2: not correct line.", INFORMATION);
endif;
GetLine(nvlocalFileHandle, svlocalLine);
nvlocalFirstPos = StrFind(svlocalLine, "[") + 1;
nvlocalLastPos = StrFind(svlocalLine, "]");
nvStrLength = nvlocalLastPos - nvlocalFirstPos;
StrSub(svTemp, svlocalLine, nvlocalFirstPos, nvStrLength);
if( StrCompare(svTemp, "COPY FILE LIST") = 0) then
blocalDone = TRUE;
endif;
endwhile;
//MessageBox("COPY_FILE: " + svlocalLine, INFORMATION);
/* get COPY_FILE 0 - no, 1 - yes */
GetLine(nvlocalFileHandle, svlocalLine);
nvlocalFirstPos = StrFind(svlocalLine, "<") + 1;
nvlocalLastPos = StrFind(svlocalLine, ">");
nvStrLength = nvlocalLastPos - nvlocalFirstPos;
StrSub(svTemp, svlocalLine, nvlocalFirstPos, nvStrLength);
if(svTemp = "0") then
blocalDone = TRUE;
else
blocalDone = FALSE;
endif;
/* get INITIAL_STATUS */
GetLine(nvlocalFileHandle, svlocalLine);
nvlocalFirstPos = StrFind(svlocalLine, "<") + 1;
nvlocalLastPos = StrFind(svlocalLine, ">");
nvStrLength = nvlocalLastPos - nvlocalFirstPos;
StrSub(svTemp, svlocalLine, nvlocalFirstPos, nvStrLength);
StrToNum(nvlocalInitialStatus, svTemp);
SetStatusWindow(nvlocalInitialStatus, "Copying files... ");
/* get the next line */
GetLine(nvlocalFileHandle, svlocalLine);
nvlocalFirstPos = StrFind(svlocalLine, "-") + 1;
nvlocalLastPos = StrFind(svlocalLine, "<");
nvStrLength = nvlocalLastPos - nvlocalFirstPos;
StrSub(svTemp, svlocalLine, nvlocalFirstPos, nvStrLength);
nvlocalFirstPos = StrFind(svlocalLine, "<") + 1;
nvlocalLastPos = StrFind(svlocalLine, ">");
nvStrLength = nvlocalLastPos - nvlocalFirstPos;
StrSub(svlocalStr, svlocalLine, nvlocalFirstPos, nvStrLength);
//MessageBox("getline: " + svTemp, INFORMATION);
while(!blocalDone)
if(svTemp = "SOURCE_LOCATION") then
nvlocalFirstPos = StrFind(svlocalLine, "<") + 1;
nvlocalLastPos = StrFind(svlocalLine, "\\");
nvStrLength = nvlocalLastPos - nvlocalFirstPos;
StrSub(svlocalStr, svlocalLine, nvlocalFirstPos, nvStrLength);
//MessageBox("1here getline: " + svlocalStr, INFORMATION);
if(svlocalStr = "SRCDIR") then
nvlocalFirstPos = StrFind(svlocalLine, "\\") + 1;
nvlocalLastPos = StrFind(svlocalLine, ">");
nvStrLength = nvlocalLastPos - nvlocalFirstPos;
StrSub(svlocalStr, svlocalLine, nvlocalFirstPos, nvStrLength);
SRCDIR = svlocalSaveSourceDir ^ svlocalStr;
//MessageBox("svlocalStr: " + svlocalStr, INFORMATION);
//MessageBox("SRCDIR = svlocalSaveSourceDir: " + SRCDIR, INFORMATION);
elseif(svlocalStr = "SRCDISK") then
nvlocalFirstPos = StrFind(svlocalLine, "\\") + 1;
nvlocalLastPos = StrFind(svlocalLine, ">");
nvStrLength = nvlocalLastPos - nvlocalFirstPos;
StrSub(svlocalStr, svlocalLine, nvlocalFirstPos, nvStrLength);
//MessageBox("2here getline: " + svlocalStr, INFORMATION);
SRCDIR = SRCDISK ^ svlocalStr;
//MessageBox("SRCDIR = SRCDISK: " + SRCDIR, INFORMATION);
else
MessageBox("Unknown value in-SOURCE_LOCATION" + svlocalLine, INFORMATION);
endif;
//MessageBox("SRCDIR: " + SRCDIR, INFORMATION);
elseif(svTemp = "TARGET_LOCATION") then
if(svlocalStr = "TARGETDIR") then
TARGETDIR = svlocalSaveTargetDir;
elseif(svlocalStr = "TARGETDISK") then
TARGETDIR = TARGETDISK;
elseif(svlocalStr = "WINDIR") then
TARGETDIR = WINDIR;
elseif(svlocalStr = "WINDISK") then
TARGETDIR = WINDISK;
elseif(svlocalStr = "WINSYSDIR") then
TARGETDIR = WINSYSDIR;
elseif(svlocalStr = "WINSYSDISK") then
TARGETDIR = WINSYSDISK;
else
MessageBox("Unknown value in-TARGET_LOCATION:" + svlocalLine, INFORMATION);
endif;
//MessageBox("TARGETDIR: " + TARGETDIR, INFORMATION);
elseif(svTemp = "FILE") then
// Let's get the BOOL value for the file plateform
nvlocalFirstPos = StrFind(svlocalLine, ":") + 1;
nvlocalLastPos = StrFind(svlocalLine, ",");
nvStrLength = nvlocalLastPos - nvlocalFirstPos;
StrSub(svlocalStr, svlocalLine, nvlocalFirstPos, nvStrLength);
StrSub(svTemp, svlocalStr, 0, 1); // Get 3x
//MessageBox("blocalDo3x: " + svTemp, INFORMATION);
if(svTemp = "1") then
blocalDo3x = TRUE;
else
blocalDo3x = FALSE;
endif;
StrSub(svTemp, svlocalStr, 1, 1); // Get 95
//MessageBox("blocalDo95: " + svTemp, INFORMATION);
if(svTemp = "1") then
blocalDo95 = TRUE;
else
blocalDo95 = FALSE;
endif;
StrSub(svTemp, svlocalStr, 2, 1); // Get NT
//MessageBox("blocalDoNT: " + svTemp, INFORMATION);
if(svTemp = "1") then
blocalDoNT = TRUE;
else
blocalDoNT = FALSE;
endif;
// This is a goofy way to do it but it seems to be the only
// way to make sure I don't do an unintensional installation.
blocalDoPlateformCopy = FALSE;
if(bWin3x) then
if(bWin3x = blocalDo3x) then
blocalDoPlateformCopy = TRUE;
endif;
endif;
if(bWin95) then
if(bWin95 = blocalDo95) then
blocalDoPlateformCopy = TRUE;
endif;
endif;
if(bWinNT3x) then
if(bWinNT3x = blocalDoNT) then
blocalDoPlateformCopy = TRUE;
endif;
endif;
if(blocalDoPlateformCopy) then
// Let's get the BOOL value for the copyset
nvlocalFirstPos = StrFind(svlocalLine, ",") + 1;
nvlocalLastPos = StrFind(svlocalLine, ">") + 1;
nvStrLength = nvlocalLastPos - nvlocalFirstPos;
StrSub(svlocalStoreStr, svlocalLine, nvlocalFirstPos, nvStrLength);
//MessageBox("BOOL: " + svlocalStoreStr, INFORMATION);
StrSub(svlocalEatStr, svlocalStoreStr, 8, 3); //
StrSub(svTemp, svlocalEatStr, 0, 1); // Get CopySet1 BOOL value
//MessageBox("blocalDoCopySet1: " + svTemp, INFORMATION);
if(svTemp = "1") then
blocalDoCopySet1 = TRUE;
else
blocalDoCopySet1 = FALSE;
endif;
StrSub(svTemp, svlocalEatStr, 1, 1); // Get CopySet2 BOOL value
//MessageBox("blocalDoCopySet2: " + svTemp, INFORMATION);
if(svTemp = "1") then
blocalDoCopySet2 = TRUE;
else
blocalDoCopySet2 = FALSE;
endif;
StrSub(svTemp, svlocalEatStr, 2, 1); // Get CopySet3 BOOL value
//MessageBox("blocalDoCopySet3: " + svTemp, INFORMATION);
if(svTemp = "1") then
blocalDoCopySet3 = TRUE;
else
blocalDoCopySet3 = FALSE;
endif;
blocalDoCopySet = FALSE;
// This is a goofy way to do it but it seems to be the only
// way to make sure I don't do an unintensional installation.
blocalDoPlateformCopy = FALSE;
if(bInclude_Copyset1) then
if(bInclude_Copyset1 = blocalDoCopySet1) then
blocalDoCopySet = TRUE;
nvlocalFileSetSize = g_numSIZE_REQ_OPTION_1;
endif;
endif;
if(bInclude_Copyset2) then
if(bInclude_Copyset2 = blocalDoCopySet2) then
blocalDoCopySet = TRUE;
nvlocalFileSetSize = g_numSIZE_REQ_OPTION_2;
endif;
endif;
if(bInclude_Copyset3) then
if(bInclude_Copyset3 = blocalDoCopySet3) then
blocalDoCopySet = TRUE;
nvlocalFileSetSize = g_numSIZE_REQ_OPTION_3;
endif;
endif;
// error message
if(nvlocalFileSetSize = 0) then
MessageBox("ERROR: SIZE_REQ_OPTION_N cannot be 0", INFORMATION);
endif;
if(blocalDoCopySet) then
// Let's get the name of the file to copy
nvlocalFirstPos = StrFind(svlocalStoreStr, ",") + 1;
nvlocalLastPos = StrFind(svlocalStoreStr, ">") + 1;
nvStrLength = nvlocalLastPos - nvlocalFirstPos;
StrSub(svlocalEatStr, svlocalStoreStr, nvlocalFirstPos, nvStrLength);
nvlocalFirstPos = StrFind(svlocalEatStr, ":") + 1;
nvlocalLastPos = StrFind(svlocalEatStr, ">");
nvStrLength = nvlocalLastPos - nvlocalFirstPos;
StrSub(svlocalFileName, svlocalEatStr, nvlocalFirstPos, nvStrLength);
// Let's get the file size.
svlocalLine = SRCDIR ^ svlocalFileName;
//MessageBox("FilePath: " + svlocalLine, INFORMATION);
GetFileInfo(svlocalLine, FILE_SIZE, nvlocalFileSize, svTemp);
nvlocalTotalFileSize = nvlocalTotalFileSize + nvlocalFileSize;
NumToStr(svTemp, nvlocalFileSize);
//MessageBox("FileSize: " + svTemp, INFORMATION);
nvlocalUpdateNum = (nvlocalTotalFileSize * 100) / (nvlocalFileSetSize);
if(nvlocalUpdateNum > 95) then
nvlocalUpdateNum = 95;
endif;
NumToStr(svTemp, nvlocalUpdateNum);
//MessageBox("nvlocalUpdateNum: " + svTemp, INFORMATION);
StatusUpdate(ON, nvlocalUpdateNum);
CopyFile(svlocalFileName, svlocalFileName);
StatusUpdate(OFF, nvlocalUpdateNum);
endif; //if(blocalDoCopySet) then
endif; //if(blocalDoPlateformCopy) then
else
blocalDone = TRUE;
//MessageBox("DONE: " + svlocalLine, INFORMATION);
endif;
GetLine(nvlocalFileHandle, svlocalLine);
nvlocalFirstPos = StrFind(svlocalLine, "-") + 1;
nvlocalLastPos = StrFind(svlocalLine, "<");
nvStrLength = nvlocalLastPos - nvlocalFirstPos;
StrSub(svTemp, svlocalLine, nvlocalFirstPos, nvStrLength);
nvlocalFirstPos = StrFind(svlocalLine, "<") + 1;
nvlocalLastPos = StrFind(svlocalLine, ">");
nvStrLength = nvlocalLastPos - nvlocalFirstPos;
StrSub(svlocalStr, svlocalLine, nvlocalFirstPos, nvStrLength);
endwhile;
CloseFile(nvlocalFileHandle);
SRCDIR = svlocalSaveSourceDir;
TARGETDIR = svlocalSaveTargetDir;
end;
/*---------------------------------------------------------------------------*\
*
* Function: CheckRequirements
*
* Purpose: This function will check all minimum requirements for the
* application being installed. If any fail, then the user
* is informed and the installation is terminated.
*
*
* Input:
*
* Returns:
*
* Comments:
\*---------------------------------------------------------------------------*/
function CheckRequirements()
NUMBER nvDx, nvDy;
NUMBER nvResult;
STRING szResult, szResult2;
begin
// Determine if target system uses NT or Windows 95.
GetSystemInfo( WINMAJOR, nvResult, szResult );
bWinNT3x = TRUE;
if (nvResult = 4) then
bWinNT3x = FALSE; // Running Windows 95.
endif;
//# COLORS check -------------
GetSystemInfo( COLORS, nvResult, szResult );
NumToStr(szResult, g_numREQ_MIN_COLORS);
if(nvResult < g_numREQ_MIN_COLORS) then
MessageBox(g_strCR_ColorMsg1 + szResult + g_strCR_ColorMsg2, INFORMATION);
endif;
// CPU check -------------
GetSystemInfo( CPU, nvResult, szResult );
if(nvResult < g_numREQ_MIN_CPU) then
NumToStr(szResult, g_numREQ_MIN_CPU);
MessageBox(g_strCR_CPUMsg1 + szResult + g_strCR_CPUMsg2, INFORMATION);
endif;
// Check screen resolution.
GetExtents( nvDx, nvDy );
if (nvDy < 480) then
MessageBox( g_strCR_ScreenResolution, WARNING );
exit;
endif;
end;
/*---------------------------------------------------------------------------*\
*
* Function: CheckSpaceRequirements
*
* Purpose: This function will check space requirements based on the
* elements being installed.
*
* Input: bInclude_Copyset1, bInclude_Copyset2, bInclude_Copyset3,
* g_numSIZE_REQ_OPTION_1, g_numSIZE_REQ_OPTION_2,
* g_numSIZE_REQ_OPTION_3
*
* Returns:
*
* Comments: For Single Install Option only, this function will only
* use SIZE_REQ_OPTION_1 to determine space required.
* Then it compares it to the available hard drive space.
* For Multiple Install Options, this function determines which
* install option and calculates the total hard drive space required.
*
\*---------------------------------------------------------------------------*/
function CheckSpaceRequirements( bInclude_Copyset1,
bInclude_Copyset2,
bInclude_Copyset3,
szDir )
number nSizeRequired;
begin
nSizeRequired = 0;
// *** DETERMINE TOTAL SIZE OF FILES TO BE INSTALLED ***.
if (bInclude_Copyset1) then
nSizeRequired = nSizeRequired + g_numSIZE_REQ_OPTION_1;
endif;
if (bInclude_Copyset2) then
nSizeRequired = nSizeRequired + g_numSIZE_REQ_OPTION_2;
endif;
if (bInclude_Copyset3) then
nSizeRequired = nSizeRequired + g_numSIZE_REQ_OPTION_3;
endif;
// *** CHECK SPACE ON TARGET DRIVE ***
bSpaceOk = TRUE;
if (GetDiskSpace( szDir ) < nSizeRequired) then
szMsg = "There is not enough space available on the disk\n" +
"'" + svMainDirectory + "' \n" +
"Please free up some space or change the target location\n" +
"to a different disk";
MessageBeep(0);
MessageBox( szMsg, WARNING );
bSpaceOk = FALSE;
endif;
return bSpaceOk;
end;
/*---------------------------------------------------------------------------*\
*
* Function: InstallReview()
*
* Purpose: This function will prompt the user to either install the product
* or review some of their system information that may be helpful to
* technical support.
*
* Comments:
\*---------------------------------------------------------------------------*/
function InstallReview()
NUMBER nvControl, nvLocalCheck1, nvLocalCheck2;
STRING svLocalMsg, svLocalText1, svLocalText2;
begin
// Provide user with option to install product or review system information
nvControl = EXCLUSIVE;
svLocalMsg = "You may install the program or review your system information.";
svLocalText1 = "Install Program";
svLocalText2 = "System Information";
nvLocalCheck1 = TRUE;
nvLocalCheck2 = FALSE;
SetDialogTitle( DLG_ASK_OPTIONS, "Options:");
Disable( BACKBUTTON );
AskOptions(nvControl, svLocalMsg, svLocalText1, nvLocalCheck1, svLocalText2, nvLocalCheck2);
Enable( BACKBUTTON );
if(nvLocalCheck2 = TRUE) then
DetermineOS();
SystemInfo();
endif;
end;
/*---------------------------------------------------------------------------*\
*
* Function: MakeIcons()
*
* Purpose: Creates the group & icon in Win3.x
* Creates the shortcut in Win95
* Creates the Personal group & icon in WinNT
*
\*---------------------------------------------------------------------------*/
function MakeIcons()
STRING svLocalProgramFolder, svLocalItemName, svLocalCommandLine;
STRING svLocalWorkingDir, svLocalIconPath;
BOOL blocalDone;
NUMBER nvlocalResult, nvlocalFileHandle;
NUMBER nvlocalFirstPos, nvlocalLastPos;
NUMBER nvStrLength;
STRING svlocalFilePath, svlocalFileName;
STRING svlocalLine, svlocalFirstChar;
STRING svTemp;
STRING svlocalStr;
STRING svlocalGROUP_NAME;
STRING svlocalITEM_NAME;
STRING svlocalAPP_PATH;
STRING svlocalAPP_DIR;
STRING svlocalICON_PATH;
begin
blocalDone = FALSE;
svlocalFilePath = SRCDIR; //"";
svlocalFileName = "Setup.ini";
OpenFileMode(FILE_MODE_NORMAL);
OpenFile(nvlocalFileHandle, svlocalFilePath, svlocalFileName);
nvlocalResult = 0;
while(!blocalDone)
nvlocalResult = nvlocalResult + 1;
if(nvlocalResult > g_numMAX_LINES_INI) then
blocalDone = TRUE;
MessageBox("Setup.ini Error3: not correct line.", INFORMATION);
endif;
GetLine(nvlocalFileHandle, svlocalLine);
nvlocalFirstPos = StrFind(svlocalLine, "[") + 1;
nvlocalLastPos = StrFind(svlocalLine, "]");
nvStrLength = nvlocalLastPos - nvlocalFirstPos;
StrSub(svTemp, svlocalLine, nvlocalFirstPos, nvStrLength);
if( StrCompare(svTemp, "ICONS") = 0) then
blocalDone = TRUE;
endif;
endwhile;
//MessageBox("ICONS: " + svlocalLine, INFORMATION);
/* get ICON_INSTALL 0 - no, 1 - yes */
GetLine(nvlocalFileHandle, svlocalLine);
nvlocalFirstPos = StrFind(svlocalLine, "<") + 1;
nvlocalLastPos = StrFind(svlocalLine, ">");
nvStrLength = nvlocalLastPos - nvlocalFirstPos;
StrSub(svTemp, svlocalLine, nvlocalFirstPos, nvStrLength);
if(svTemp = "0") then
blocalDone = TRUE;
else
blocalDone = FALSE;
endif;
/* this should be the first icon info line */
GetLine(nvlocalFileHandle, svlocalLine);
nvlocalFirstPos = StrFind(svlocalLine, "-") + 1;
nvlocalLastPos = StrFind(svlocalLine, "<");
nvStrLength = nvlocalLastPos - nvlocalFirstPos;
StrSub(svTemp, svlocalLine, nvlocalFirstPos, nvStrLength);
while(!blocalDone)
SetStatusWindow( 100, "Creating Folder and Icons...." );
nvlocalFirstPos = StrFind(svlocalLine, "<") + 1;
nvlocalLastPos = StrFind(svlocalLine, ">");
nvStrLength = nvlocalLastPos - nvlocalFirstPos;
StrSub(svlocalStr, svlocalLine, nvlocalFirstPos, nvStrLength);
if(svTemp = "GROUP_NAME") then
svlocalGROUP_NAME = svlocalStr;
//MessageBox("svlocalGROUP_NAME: " + svlocalGROUP_NAME, INFORMATION);
elseif(svTemp = "ITEM_NAME") then
svlocalITEM_NAME = svlocalStr;
//MessageBox("svlocalITEM_NAME: " + svlocalITEM_NAME, INFORMATION);
elseif(svTemp = "APP_PATH") then
nvlocalFirstPos = StrFind(svlocalLine, "<") + 1;
nvlocalLastPos = StrFind(svlocalLine, "\\");
nvStrLength = nvlocalLastPos - nvlocalFirstPos;
StrSub(svlocalStr, svlocalLine, nvlocalFirstPos, nvStrLength);
if(svlocalStr = "TARGETDIR") then
svlocalAPP_DIR = TARGETDIR;
svlocalAPP_PATH = svlocalAPP_DIR;
nvlocalFirstPos = StrFind(svlocalLine, "\\") + 1;
nvlocalLastPos = StrFind(svlocalLine, ">");
nvStrLength = nvlocalLastPos - nvlocalFirstPos;
StrSub(svlocalStr, svlocalLine, nvlocalFirstPos, nvStrLength);
svlocalAPP_PATH = svlocalAPP_DIR + svlocalStr;
endif;
elseif(svTemp = "ICON_PATH") then
if(svlocalStr = "NULL") then
svlocalICON_PATH = "";
else
svlocalICON_PATH = svlocalStr;
endif;
if(bWin95 || bWinNT3x || bWinNT40) then
LongPathToQuote(svlocalAPP_PATH, TRUE); // adds quotes to a long file name
endif;
AddFolderIcon( svlocalGROUP_NAME, svlocalITEM_NAME, svlocalAPP_PATH,
svlocalAPP_DIR, svlocalICON_PATH, 0, "", REPLACE );
else
blocalDone = TRUE;
endif;
/* get the next line */
GetLine(nvlocalFileHandle, svlocalLine);
nvlocalFirstPos = StrFind(svlocalLine, "-") + 1;
nvlocalLastPos = StrFind(svlocalLine, "<");
nvStrLength = nvlocalLastPos - nvlocalFirstPos;
StrSub(svTemp, svlocalLine, nvlocalFirstPos, nvStrLength);
endwhile;
CloseFile(nvlocalFileHandle);
end;
/*---------------------------------------------------------------------------*\
*
* Function: WriteTextFile()
*
* Purpose: This function will write to the specified text based file.
*
* Input:
*
* Returns:
*
* Comments: Normally the text file written is the .INI file.
* Verify that this section writes the file to the proper directory
*
*
\*---------------------------------------------------------------------------*/
function WriteTextFile()
NUMBER nvLocalResult, nvlocalMakeTextFileHandle;
STRING svlocalMakeTextFilePath, svlocalMakeTextFileName;
STRING svLocalMECCString;
BOOL blocalDone;
BOOL blocalCreateTextFile;
NUMBER nvlocalResult, nvlocalFileHandle;
NUMBER nvlocalFirstPos, nvlocalLastPos;
NUMBER nvStrLength;
STRING svlocalFilePath, svlocalFileName;
STRING svlocalLine, svlocalFirstChar;
STRING svTemp;
STRING svlocalBuildPath;
begin
blocalDone = FALSE;
blocalCreateTextFile = FALSE;
svlocalFilePath = SRCDIR; //"";
svlocalFileName = "Setup.ini";
OpenFileMode(FILE_MODE_NORMAL);
OpenFile(nvlocalFileHandle, svlocalFilePath, svlocalFileName);
nvlocalResult = 0;
while(!blocalDone)
nvlocalResult = nvlocalResult + 1;
if(nvlocalResult > g_numMAX_LINES_INI) then
blocalDone = TRUE;
MessageBox("Setup.ini Error4: not correct line.", INFORMATION);
endif;
GetLine(nvlocalFileHandle, svlocalLine);
nvlocalFirstPos = StrFind(svlocalLine, "[") + 1;
nvlocalLastPos = StrFind(svlocalLine, "]");
nvStrLength = nvlocalLastPos - nvlocalFirstPos;
StrSub(svTemp, svlocalLine, nvlocalFirstPos, nvStrLength);
if( StrCompare(svTemp, "TEXT FILE INFO") = 0) then
blocalDone = TRUE;
endif;
endwhile;
/* ********************* get TEXT_FILE_USED // 0 - no, 1 - yes ************************ */
GetLine(nvlocalFileHandle, svlocalLine);
nvlocalFirstPos = StrFind(svlocalLine, "<") + 1;
nvlocalLastPos = StrFind(svlocalLine, ">");
nvStrLength = nvlocalLastPos - nvlocalFirstPos;
StrSub(svTemp, svlocalLine, nvlocalFirstPos, nvStrLength);
if(svTemp = "0") then
blocalCreateTextFile = FALSE;
else
blocalCreateTextFile = TRUE;
endif;
//MessageBox("TEXT_FILE_USED: " + svTemp, INFORMATION);
if(blocalCreateTextFile) then
/* ********************* get TEXT_NAME:name of file to create************************ */
GetLine(nvlocalFileHandle, svlocalLine);
nvlocalFirstPos = StrFind(svlocalLine, "<") + 1;
nvlocalLastPos = StrFind(svlocalLine, ">");
nvStrLength = nvlocalLastPos - nvlocalFirstPos;
StrSub(svTemp, svlocalLine, nvlocalFirstPos, nvStrLength);
svlocalMakeTextFileName = svTemp;
OpenFileMode(FILE_MODE_APPEND);
/* ********************* get PATH:location file is to be created at.***************** */
GetLine(nvlocalFileHandle, svlocalLine);
nvlocalFirstPos = StrFind(svlocalLine, "<") + 1;
nvlocalLastPos = StrFind(svlocalLine, ">");
nvStrLength = nvlocalLastPos - nvlocalFirstPos;
StrSub(svTemp, svlocalLine, nvlocalFirstPos, nvStrLength);
if(svTemp = "WINDIR") then
svlocalMakeTextFilePath = WINDIR;
//MessageBox("WINDIR: " + svlocalMakeTextFilePath, INFORMATION);
elseif(svTemp = "WINSYSDIR") then
svlocalMakeTextFilePath = WINSYSDIR;
//MessageBox("WINSYSDIR: " + svlocalMakeTextFilePath, INFORMATION);
elseif(svTemp = "TARGETDIR") then
svlocalMakeTextFilePath = svMainDirectory;
//MessageBox("TARGETDIR: " + svlocalMakeTextFilePath, INFORMATION);
endif;
if(CreateFile(nvlocalMakeTextFileHandle, svlocalMakeTextFilePath, svlocalMakeTextFileName) < 0) then
//MessageBox("could not be created", INFORMATION);
endif;
blocalDone = FALSE;
while(!blocalDone)
nvlocalResult = nvlocalResult + 1;
if(nvlocalResult > g_numMAX_LINES_INI) then
blocalDone = TRUE;
MessageBox("Setup.ini Error5: not correct line.", INFORMATION);
endif;
GetLine(nvlocalFileHandle, svlocalLine);
nvlocalFirstPos = StrFind(svlocalLine, "-") + 1;
nvlocalLastPos = StrFind(svlocalLine, "<");
nvStrLength = nvlocalLastPos - nvlocalFirstPos;
StrSub(svTemp, svlocalLine, nvlocalFirstPos, nvStrLength);
if( StrCompare(svTemp, "LINE") = 0) then
blocalDone = TRUE;
elseif( StrCompare(svTemp, "PATH") = 0) then
blocalDone = TRUE;
endif;
endwhile;
blocalDone = FALSE;
while(!blocalDone)
//MessageBox("Current Line" + svTemp, INFORMATION);
if(svTemp = "LINE") then
nvlocalFirstPos = StrFind(svlocalLine, "<") + 1;
nvlocalLastPos = StrFind(svlocalLine, ">");
nvStrLength = nvlocalLastPos - nvlocalFirstPos;
StrSub(svTemp, svlocalLine, nvlocalFirstPos, nvStrLength);
WriteLine(nvlocalMakeTextFileHandle, svTemp);
elseif(svTemp = "PATH") then
svlocalBuildPath = "";
nvlocalFirstPos = StrFind(svlocalLine, "<") + 1;
nvlocalLastPos = StrFind(svlocalLine, "=") + 1;
nvStrLength = nvlocalLastPos - nvlocalFirstPos;
StrSub(svTemp, svlocalLine, nvlocalFirstPos, nvStrLength);
svlocalBuildPath = svlocalBuildPath + svTemp;
nvlocalFirstPos = StrFind(svlocalLine, "=") + 1;
nvlocalLastPos = StrFind(svlocalLine, "\\");
nvStrLength = nvlocalLastPos - nvlocalFirstPos;
StrSub(svTemp, svlocalLine, nvlocalFirstPos, nvStrLength);
if(svTemp = "SRCDIR") then
svlocalBuildPath = svlocalBuildPath + SRCDIR;
elseif(svTemp = "SRCDISK") then
svlocalBuildPath = svlocalBuildPath + SRCDISK;
elseif(svTemp = "TARGETDIR") then
svlocalBuildPath = svlocalBuildPath + TARGETDIR;
elseif(svTemp = "WINDIR") then
svlocalBuildPath = svlocalBuildPath + WINDIR;
else //WINSYSDIR
svlocalBuildPath = svlocalBuildPath + WINSYSDIR;
endif;
nvlocalFirstPos = StrFind(svlocalLine, "\\") + 1;
nvlocalLastPos = StrFind(svlocalLine, ">");
nvStrLength = nvlocalLastPos - nvlocalFirstPos;
StrSub(svTemp, svlocalLine, nvlocalFirstPos, nvStrLength);
svlocalBuildPath = svlocalBuildPath + svTemp;
//MessageBox("PATH: " + svlocalBuildPath, INFORMATION);
WriteLine(nvlocalMakeTextFileHandle, svlocalBuildPath);
else
blocalDone = TRUE;
endif;
GetLine(nvlocalFileHandle, svlocalLine);
nvlocalFirstPos = StrFind(svlocalLine, "-") + 1;
nvlocalLastPos = StrFind(svlocalLine, "<");
nvStrLength = nvlocalLastPos - nvlocalFirstPos;
StrSub(svTemp, svlocalLine, nvlocalFirstPos, nvStrLength);
endwhile;
CloseFile(nvlocalMakeTextFileHandle);
endif;
end;
/*---------------------------------------------------------------------------*\
*
* Function: Additional_Registry_Info
*
* Purpose: This function will create necessary keys and values in
* the Registry for Windows 95 and Windows NT
*
* Input:
*
* Returns:
*
\*---------------------------------------------------------------------------*/
function Additional_Registry_Info()
BOOL blocalDone;
STRING svTemp;
STRING svlocalStr;
STRING svlocalROOT_KEY;
STRING svlocalKEY;
STRING svlocalKEY_NAME;
begin
OpenSetupFile();
// *************************** [REGISTRY KEY INFO] *************************************
FindLine("[", "]", "REGISTRY KEY INFO");
GetNextLine( "<", ">" );
svTemp = svglobalReturnStr;
//MessageBox("Add reg 0-1: " + svTemp, INFORMATION);
blocalDone = FALSE;
if(svTemp = "0") then
blocalDone = TRUE;
endif;
GetNextLine( "-", "<" );
svTemp = svglobalReturnStr;
//MessageBox("Line: " + svTemp, INFORMATION);
while(!blocalDone)
GetCurrentLine( "<", ">" );
svlocalStr = svglobalReturnStr;
//MessageBox("svlocalStrLine: " + svlocalStr, INFORMATION);
if(svTemp = "ROOT_KEY") then
svlocalROOT_KEY = svlocalStr;
//MessageBox("ROOT_KEY: " + svlocalLine, INFORMATION);
if(svlocalROOT_KEY = "HKEY_CLASSES_ROOT") then
RegDBSetDefaultRoot( HKEY_CLASSES_ROOT );
elseif(svlocalROOT_KEY = "HKEY_CURRENT_USER") then
RegDBSetDefaultRoot( HKEY_CURRENT_USER );
elseif(svlocalROOT_KEY = "HKEY_LOCAL_MACHINE") then
RegDBSetDefaultRoot( HKEY_LOCAL_MACHINE );
elseif(svlocalROOT_KEY = "HKEY_USERS") then
RegDBSetDefaultRoot( HKEY_USERS );
elseif(svlocalROOT_KEY = "HKEY_CURRENT_CONFIG") then
RegDBSetDefaultRoot( HKEY_CURRENT_CONFIG );
elseif(svlocalROOT_KEY = "HKEY_DYN_DATA") then
RegDBSetDefaultRoot( HKEY_DYN_DATA );
endif;
elseif(svTemp = "KEY") then
svlocalKEY = svlocalStr;
RegDBCreateKeyEx( svlocalKEY, "" );
//MessageBox("KEY: " + svlocalLine, INFORMATION);
elseif(svTemp = "KEY_NAME") then
svlocalKEY_NAME = svlocalStr;
//MessageBox("KEY_NAME: " + svlocalLine, INFORMATION);
elseif(svTemp = "REGDB_STRING") then
if(svlocalStr = "SRCDIR") then
RegDBSetKeyValueEx( svlocalKEY, svlocalKEY_NAME, REGDB_STRING, SRCDIR, -1 );
elseif(svlocalStr = "TARGETDIR") then
RegDBSetKeyValueEx( svlocalKEY, svlocalKEY_NAME, REGDB_STRING, TARGETDIR, -1 );
elseif(svlocalStr = "WINDIR") then
RegDBSetKeyValueEx( svlocalKEY, svlocalKEY_NAME, REGDB_STRING, WINDIR, -1 );
elseif(svlocalStr = "WINSYSDIR") then
RegDBSetKeyValueEx( svlocalKEY, svlocalKEY_NAME, REGDB_STRING, WINSYSDIR, -1 );
else
RegDBSetKeyValueEx( svlocalKEY, svlocalKEY_NAME, REGDB_STRING, svlocalStr, -1 );
endif;
//MessageBox("REGDB_STRING: " + svlocalLine, INFORMATION);
elseif(svTemp = "REGDB_NUMBER") then
RegDBSetKeyValueEx( svlocalKEY, svlocalKEY_NAME, REGDB_NUMBER, svlocalStr, -1 );
//MessageBox("REGDB_NUMBER: " + svlocalLine, INFORMATION);
else
blocalDone = TRUE;
endif;
GetNextLine( "-", "<" );
svTemp = svglobalReturnStr;
//MessageBox("nextLine: " + svTemp, INFORMATION);
endwhile;
CloseSetupFile();
end;
/*---------------------------------------------------------------------------*\
*
* Function: CreateRegDBEntries
*
* Purpose: This function will create necessary keys and values in
* the Registry for Windows 95 and Windows NT
*
* Input: EXTENTION_USED, EXTENTION, TARGETDIR
*
* Returns:
*
* Comments: Edit these function as needed.
\*---------------------------------------------------------------------------*/
function CreateRegDBEntries()
string szKey[255], szValue, szDemo, szProgram;
STRING szName, svTemp, svRegStr, svRegKeyName;
NUMBER nRegReturn, nvType, nRegValue;
begin
// *** CREATE FILE EXTENTION ENTRIES (SAVED GAME) IN REGISTRY: HKEY_CLASSES_ROOT ***
if(g_numEXTENSION_USED = 1) then
RegDBSetDefaultRoot( HKEY_CLASSES_ROOT );
szKey = "." + g_strEXTENSION; // Example: szKey = ".ot2";
RegDBCreateKeyEx( szKey, "" );
svTemp = g_strEXTENSION + "file";
RegDBSetKeyValueEx( szKey, "", REGDB_STRING, svTemp, -1 );
// Example: RegDBSetKeyValueEx( szKey, "", REGDB_STRING, "ot2file", -1 );
RegDBSetDefaultRoot( HKEY_CLASSES_ROOT );
szKey = g_strEXTENSION + "file"; // Example: szKey = "ot2file";
RegDBCreateKeyEx( szKey, "" );
RegDBSetDefaultRoot( HKEY_CLASSES_ROOT );
szKey = g_strEXTENSION + "file\\DefaultIcon"; // Example: szKey = "ot2file\\DefaultIcon"
RegDBCreateKeyEx( szKey, "" );
// *** USES USER DEFINED TARGET DIRECTORY ***
szProgram = TARGETDIR + szApplicationName + ",1"; //TARGETDIR ^ "\\africa32.EXE,1";
// Example: szProgram = TARGETDIR ^ "\\OTII32.EXE,1"
RegDBSetKeyValueEx( szKey, "", REGDB_STRING, szProgram, -1 );
RegDBSetDefaultRoot( HKEY_CLASSES_ROOT );
szKey = g_strEXTENSION + "file\\shell"; //"afrfile\\shell";
// Example: szKey = "plafile\\shell";
RegDBCreateKeyEx( szKey, "" );
RegDBSetDefaultRoot( HKEY_CLASSES_ROOT );
szKey = g_strEXTENSION + "file\\shell\\open"; //"afrfile\\shell\\open";
// Example: szKey = "plafile\\shell\\open";
RegDBCreateKeyEx( szKey, "" );
szKey = g_strEXTENSION + "file\\shell\\open\\command"; //"afrfile\\shell\\open\\command";
RegDBCreateKeyEx( szKey, "" );
szProgram = TARGETDIR + szApplicationName + ' "%1"'; // %1 refers to which icon to display
if(bWin95) then
// LongPathToQuote( szProgram, TRUE );
endif;
RegDBSetKeyValueEx( szKey, "", REGDB_STRING, szProgram, -1 );
endif;
// *** CREATE ENTRIES IN REGISTRY: HKEY_LOCAL_MACHINE ***
RegDBSetDefaultRoot( HKEY_LOCAL_MACHINE );
szKey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\" + g_strPRODUCT_NAME;
// *** QUESTION What do these line do?
if(bWin95) then
// LongPathToQuote( szKey, TRUE );
endif;
RegDBCreateKeyEx( szKey, "" );
RegDBSetKeyValueEx( szKey, "", REGDB_STRING, svMainDirectory, -1 );
end;
/* -------------------------------------------------------------------------*\
* Function: Load_Message_Strings()
*
* Purpose: To copy the messages in the Setup.ini file to the installer.
*
* Input:
*
* Returns:
*
* Comments:
\* -------------------------------------------------------------------------*/
function Load_Message_Strings()
begin
OpenSetupFile();
FindLine("[", "]", "MESSAGE STRINGS");
GetNextLine( "<", ">" );
// ********************************************************** function:<SetupScreen>
GetNextLine( "<", ">" );
g_strSS_SetTitle = svglobalReturnStr;
//MessageBox("g_strSS_SetTitle: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
// ********************************************************** function:<System Info>
GetNextLine( "<", ">" );
g_strSI_Title = svglobalReturnStr;
//MessageBox("g_strSI_Title: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
g_strSI_Msg = svglobalReturnStr;
//MessageBox("g_strSI_Msg: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
g_strSI_System = svglobalReturnStr;
//MessageBox("g_strSI_System: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
g_strSI_CPU = svglobalReturnStr;
//MessageBox("g_strSI_CPU: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
g_strSI_MEM = svglobalReturnStr;
//MessageBox("g_strSI_MEM: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
g_strSI_BASEMEM = svglobalReturnStr;
//MessageBox("g_strSI_BASEMEM: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
g_strSI_EXTENDEDMEM = svglobalReturnStr;
//MessageBox("g_strSI_EXTENDEDMEM: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
g_strSI_VIDEO = svglobalReturnStr;
//MessageBox("g_strSI_VIDEO: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
g_strSI_COLORS = svglobalReturnStr;
//MessageBox("g_strSI_COLORS: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
g_strSI_Resolution = svglobalReturnStr;
//MessageBox("g_strSI_Resolution: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
g_strSI_Unknown = svglobalReturnStr;
//MessageBox("g_strSI_Unknown: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
g_strSI_Beyond = svglobalReturnStr;
//MessageBox("g_strSI_Beyond: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
g_strSI_VideoDrTypMsg = svglobalReturnStr;
//MessageBox("g_strSI_VideoDrTypMsg: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
g_strSI_VideoTypMsg = svglobalReturnStr;
//MessageBox("g_strSI_VideoTypMsg: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
g_strSI_MidiDrTypMsg = svglobalReturnStr;
//MessageBox("g_strSI_MidiDrTypMsg: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
g_strSI_MULTIMEDMSG = svglobalReturnStr;
//MessageBox("g_strSI_MULTIMEDMSG: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
g_strSI_Detected = svglobalReturnStr;
//MessageBox("g_strSI_Detected: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
g_strSI_NotDetected = svglobalReturnStr;
//MessageBox("g_strSI_NotDetected: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
g_strSI_Avi = svglobalReturnStr;
//MessageBox("g_strSI_Avi: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
g_strSI_QTW = svglobalReturnStr;
//MessageBox("g_strSI_QTW: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
g_strSI_Wave = svglobalReturnStr;
//MessageBox("g_strSI_Wave: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
g_strSI_DriveInfo = svglobalReturnStr;
//MessageBox("g_strSI_DriveInfo: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
g_strSI_CDROM = svglobalReturnStr;
//MessageBox("g_strSI_CDROM: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
g_strSI_DrTypeFixed = svglobalReturnStr;
//MessageBox("g_strSI_DrTypeFixed: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
g_strSI_DrTypeRemov = svglobalReturnStr;
//MessageBox("g_strSI_DrTypeRemov: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
g_strSI_DrTypeRemote = svglobalReturnStr;
//MessageBox("g_strSI_DrTypeRemote: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
g_strSI_FreeSpace = svglobalReturnStr;
//MessageBox("g_strSI_FreeSpace: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
g_strSI_MB = svglobalReturnStr;
//MessageBox("g_strSI_MB: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
// ******************************************* function:<CompressedFileTransferList>
GetNextLine( "<", ">" );
g_strCFTL_SetStatusWindowMsg = svglobalReturnStr;
//MessageBox("g_strCFTL_SetStatusWindowMsg: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
// ******************************************* function:<Multiple_Installation_Options>
GetNextLine( "<", ">" );
g_strMIO_SetupType = svglobalReturnStr;
//MessageBox("g_strMIO_SetupType: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
g_strMIO_SetDialogTitle = svglobalReturnStr;
//MessageBox("g_strMIO_SetDialogTitle: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
g_strMIO_AskOptionsMessage = svglobalReturnStr;
//MessageBox("g_strMIO_AskOptionsMessage: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
g_strMIO_AskOptionsDescription1 = svglobalReturnStr;
//MessageBox("g_strMIO_AskOptionsDescription1: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
g_strMIO_AskOptionsDescription2 = svglobalReturnStr;
//MessageBox("g_strMIO_AskOptionsDescription2: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
g_strMIO_AskOptionsDescription3 = svglobalReturnStr;
//MessageBox("g_strMIO_AskOptionsDescription3: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
// ******************************************* function:<CheckRequirements>
GetNextLine( "<", ">" );
g_strCR_ColorMsg1 = svglobalReturnStr;
//MessageBox("g_strCR_ColorMsg1: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
g_strCR_ColorMsg2 = svglobalReturnStr;
//MessageBox("g_strCR_ColorMsg2: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
g_strCR_CPUMsg1 = svglobalReturnStr;
//MessageBox("g_strCR_CPUMsg2: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
g_strMIO_AskOptionsDescription1 = svglobalReturnStr;
//MessageBox("g_strMIO_AskOptionsDescription1: " + svglobalReturnStr, INFORMATION);
GetNextLine( "<", ">" );
g_strCR_ScreenResolution = svglobalReturnStr;
//MessageBox("g_strCR_ScreenResolution: " + svglobalReturnStr, INFORMATION);
CloseSetupFile();
end;
/*---------------------------------------------------------------------------*\
*
* Function: OpenSetupFile
*
* Purpose: Opens the Setup.ini file.
*
* Input:
*
* Returns:
*
* Comments:
\*---------------------------------------------------------------------------*/
function OpenSetupFile()
begin
svglobalFilePath = SRCDIR;
svglobalFileName = "Setup.ini";
OpenFileMode(FILE_MODE_NORMAL);
OpenFile(nglobalFileHandle, svglobalFilePath, svglobalFileName);
end;
/*---------------------------------------------------------------------------*\
*
* Function: CloseSetupFile
*
* Purpose: Closes the Setup.ini file.
*
* Input:
*
* Returns:
*
* Comments:
\*---------------------------------------------------------------------------*/
function CloseSetupFile()
begin
CloseFile(nglobalFileHandle);
end;
/*---------------------------------------------------------------------------*\
*
* Function: FindLine( string, string, string );
*
* Purpose: Closes the Setup.ini file.
*
* Input:
*
* Returns:
*
* Comments:
\*---------------------------------------------------------------------------*/
function FindLine( svFirstChar, svLastChar, svFindStr )
BOOL blocalDone;
NUMBER nvlocalFirstPos;
NUMBER nvlocalLastPos;
NUMBER nvStrLength;
NUMBER nvLineNum;
STRING svlocalLine;
begin
blocalDone = FALSE;
nvLineNum = 0;
while(!blocalDone)
nvLineNum = nvLineNum + 1;
if(nvLineNum > g_numMAX_LINES_INI) then
blocalDone = TRUE;
MessageBox("FindLine Setup.ini Error: not correct line.", INFORMATION);
endif;
GetLine(nglobalFileHandle, svlocalLine);
nvlocalFirstPos = StrFind(svlocalLine, svFirstChar) + 1;
nvlocalLastPos = StrFind(svlocalLine, svLastChar);
nvStrLength = nvlocalLastPos - nvlocalFirstPos;
StrSub(svglobalReturnStr, svlocalLine, nvlocalFirstPos, nvStrLength);
//MessageBox("svglobalReturnStr: " + svglobalReturnStr + " svlocalLine: " + svlocalLine, INFORMATION);
if( StrCompare(svglobalReturnStr, svFindStr) = 0) then
blocalDone = TRUE;
endif;
endwhile;
end;
/*---------------------------------------------------------------------------*\
*
* Function: GetNextLine( svFirstChar, svLastChar );
*
* Purpose: Sets svglobalReturnStr to be the string that is bound by
* svFirstChar, svLastChar. Sets svglobalLineStr to the current line.
*
* Input: svFirstChar, svLastChar
*
* Returns:
*
* Comments:
\*---------------------------------------------------------------------------*/
function GetNextLine( svFirstChar, svLastChar )
NUMBER nvlocalFirstPos;
NUMBER nvlocalLastPos;
NUMBER nvStrLength;
begin
GetLine(nglobalFileHandle, svglobalLineStr);
nvlocalFirstPos = StrFind(svglobalLineStr, svFirstChar) + 1;
nvlocalLastPos = StrFind(svglobalLineStr, svLastChar);
nvStrLength = nvlocalLastPos - nvlocalFirstPos;
StrSub(svglobalReturnStr, svglobalLineStr, nvlocalFirstPos, nvStrLength);
end;
/*---------------------------------------------------------------------------*\
*
* Function: GetCurrentLine( svFirstChar, svLastChar );
*
* Purpose: Sets svglobalReturnStr to be the string that is bound by
* svFirstChar, svLastChar. Sets svglobalLineStr to the current line.
*
* Input: svFirstChar, svLastChar
*
* Returns:
*
* Comments:
\*---------------------------------------------------------------------------*/
function GetCurrentLine( svFirstChar, svLastChar )
NUMBER nvlocalFirstPos;
NUMBER nvlocalLastPos;
NUMBER nvStrLength;
begin
nvlocalFirstPos = StrFind(svglobalLineStr, svFirstChar) + 1;
nvlocalLastPos = StrFind(svglobalLineStr, svLastChar);
nvStrLength = nvlocalLastPos - nvlocalFirstPos;
StrSub(svglobalReturnStr, svglobalLineStr, nvlocalFirstPos, nvStrLength);
end;